package lesson06.timer;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2023/01/13  15:58
 */
public class Demo_Timer02 {
    public static void main(String[] args) throws InterruptedException {
        MyTimer myTimer = new MyTimer();
        myTimer.schedule(() -> {
            System.out.println("任务1");
        },10000);
        myTimer.schedule(() -> {
            System.out.println("任务4");
        },1000);
        myTimer.schedule(() -> {
            System.out.println("任务3");
        },3000);
        myTimer.schedule(() -> {
            System.out.println("任务5");
        },4000);
        myTimer.schedule(() -> {
            System.out.println("任务2");
        },5000);
//        myTimer.schedule(() -> {
//            System.out.println("任务6");
//        },-2000);
    }
}
